package cn.js.sip.rat.system.thymeleaf;

import cn.js.sip.rat.system.entity.DicDataEntity;
import cn.js.sip.rat.system.service.SysDicDataService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName: cn.js.sip.rat.system.thymeleaf
 * @Description: TODO
 * @author: xuxiaoli
 * @Date: 2019-12-31   13:42
 */
@Service("dict")
public class DictService {
    @Resource(name = "dicDataService")
    private SysDicDataService dictDataService;

    /**
     * 根据字典类型查询字典数据信息
     *
     * @param dictType 字典类型
     * @return 参数键值
     */
    public List<DicDataEntity> getType(String dictType) {
        return dictDataService.selectDictDataByType(dictType);
    }

    /**
     * 根据字典类型和字典键值查询字典数据信息
     *
     * @param dictType  字典类型
     * @param dictValue 字典键值
     * @return 字典标签
     */
    public String getLabel(String dictType, String dictValue) {
        return dictDataService.selectDictLabel(dictType, dictValue);
    }
}
